DIMN

Syntax: DIMN (array [,dimension] )     
    or: DIMN (array (dimension {,dimension} ) )
Location: QL ROM

This function allows you to investigate the size of the given index of a specified array.  The first syntax is the most common: it will return the specified dimension (index) used in the original DIM statement when the array was defined. If the index did not exist, then a result of zero is returned. If dimension is not specified, then the size of the first index is returned.

The second syntax is somewhat obscure and has no practical advantages. This second syntax will not allow you to access the size of the first index. It works by reference to the array itself, for example,

PRINT DIMN(a$(1))

will return the size of the second index, and  

PRINT DIMN(a$(1,1))

will return the size of the third index and so forth. Once the number of dimensions used within the DIMN statement has reached the number used by the array, theore are specified, then the error 'Out of Range' will result.

Example:
DIM a$(10,12)
PRINT DIMN (a$)                 Prints 10
PRINT DIMN (a$,2)               Prints 12
PRINT DIMN (a$(1,1))            Returns 1

CROSS-REFERENCE:
LEN will return the actual length of characters held within a string.
DIM initialises an array.
